<?php
/**
 * Dcolors,The Community Application for Web
 *
 * admin class
 *
 * Not free software
 * @author     chopin xiao <x@sunsne.com>
 * @copyright  2009 The Dcolors Group
 * @version    SVN: $Id: admin.php 15 2009-01-19 11:36:08Z chopins.xiao $
 **/

require_once('../APP/init.php');
class admin extends Init
{
	public function __construct()
	{
		Init::__construct();
		if($this->sid == null)
		{
			$this->Denid();
		}elseif(empty($_SESSION['admin']))
		{
			$this->Login();
		}else{
			$this->Init();
		}
		
	}
	public function Login()
	{
		LoadFunction::LoadControl('Login',true);
	}
	public function Init()
	{
		if($action = $this->action())
		{
			if(LoadFunction::LoadControl($action,true))
			{
				return new $action;
			}else{
				$this->Error();
			}
		}
	}
	public function Denid()
	{
		echo 'Access Denied';
	}
	public function Error()
	{
		echo 'error';
	}
}
return new admin();